<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>title: </title>
<script type="text/javascript">
	function content_submit(){
		var f=document.write_form;
		if(f.title.value==""){
			alert("제목을 입력하세요!");
			f.title.focus();
			return; 
		}	
		if(f.content.value==""){
			alert("내용을 입력하세요!");
			f.content.focus();
			return;
		}	
		f.submit();
	}
	function img_check(){
		var filename=document.getElementById('uploadFile').value;
		var extension=filename.split('.');
		if(!(extension[1]=='jpg' || extension[1]=='gif' || extension[1]=='png' || extension[1]=='bmp' ||
				extension[1]=='JPG' || extension[1]=='GIF' || extension[1]=='PNG' || extension[1]=='BMP')){
			alert("사진파일만 올릴 수 있습니다. (JPG, GIF, PNG, BMP)");
			document.getElementById("uploadFile").value="";
		}
	}
</script>
</head>
<body>	
<font size="2">
<form name="write_form"  method=post action="board.do" enctype="multipart/form-data">
	<input type="hidden" name="command" value="answerBoard"></input>	
    <input type="hidden" name="id" value=${sessionScope.vo.id }></input>
    <input type="hidden" name="nick" value=${sessionScope.vo.nick }></input>
    <input type="hidden" name="board_no" value=${bvo.board_no }></input>
	<input type=hidden name=ref value=${bvo.ref }></input>
	<input type=hidden name=restep value=${bvo.restep }></input>
	<input type=hidden name=relevel value=${bvo.relevel }></input>
    <input type="hidden" name="kind" value=${param.kind }></input>
    <input type="hidden" name="view" value=${param.view }></input>
	<table width="740" cellpadding="10"
			style="border-top:lightgray 1px solid;
					border-bottom:lightgray 1px solid;
					border-left:lightgray 1px solid;
					border-right:lightgray 1px solid;">
<tr>
<td>
  <table  width="730" cellpadding="2">
  	<tr>
  		<td width="10%">카테고리</td>
  		<td>
  			<select>
  				<option>---</option>
  			</select>
  			</td>
  	</tr>
    <tr>
     <td>제목</td>
     <td><input type="text" name="title" maxlength="100" size="60%"  onclick="clearTitle()"
     			style="color: gray";
     			value="${requestScope.bvo.title }">
      </td>
    </tr>
	<c:if test="${param.kind!='default' }">
	<tr>
		<td>파일</td>
		<td>
			<c:choose>
	     	<c:when test="${param.kind=='picture' }">
	     		<input type="file" name="uploadFile" id="uploadFile" style='cursor: pointer;' onchange="img_check()">
	     	</c:when>
	     	<c:when test="${param.kind=='file' }">
	     		<input type="file" name="uploadFile" style='cursor: pointer;'>
	     	</c:when>
	     	</c:choose>
		</td>
	</tr>
	</c:if>
	<tr>
     <td colspan="2">
     <textarea cols="35" rows="10" name="content" 
				     style="width:100%;
				     			height:400px;
				     			overflow-x:hidden;
				     			overflow-y:auto;
				     			font-size:9pt;
				     			resize:none;">
>
${requestScope.bvo.content }</textarea>
     </td>
    </tr> 
   </table>
   </td>
   </tr>
  </table>
  <font size="2">저작권 등 다른 사람의 권리를 침해하거나 명예를 훼손하는 게시물은 이용약관 및 관련법률에 의해 제재를 받으실 수 있습니다.</font><br>
 <center> <img alt="확인" src="img/board/confirm_btn.gif" onclick="content_submit()" style='cursor: pointer;'></center>
  </form>
    <%--처리후 새로고침시 db 재입력 방지 flag --%>
	<% session.setAttribute("flag",true); %>
</font>
</body>
</html>














